package tomsung.cloud.agdc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tomsung.cloud.agdc.bean.CropStep;
import tomsung.cloud.agdc.dao.CropStepMapper;

@Service("CropStepService")
public class CropStepService {

	@Autowired
	CropStepMapper cropStepMapper;
	
	public int createCropStepData(CropStep record)
	{
		return cropStepMapper.insertSelective(record);
	}
	
	public int deleteCropStepData(Integer cropId, Integer cropType, Integer plantType)
	{
		return cropStepMapper.deleteByPrimaryKey(cropId,cropType, plantType);
	}
	
	public List<CropStep> selectCropStepData(Integer cropId, Integer cropType, Integer plantType)
	{
		return cropStepMapper.selectByPrimaryKey(cropId, cropType, plantType);
	}
	
	public List<CropStep> selectCropStepData()
	{
		return cropStepMapper.selectAll();
	}
	
	public int updateCropStepData(CropStep record)
	{
		return cropStepMapper.updateByPrimaryKey(record);
	}
}
